package com.evil.application.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.evil.application.pojo.dto.view.config.filter.FilterGroupConfigDTO;
import com.evil.application.pojo.entity.ApplicationFilterGroup;
import com.evil.application.pojo.entity.ApplicationFilterItem;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 应用筛选项表
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
public interface ApplicationFilterItemService extends IService<ApplicationFilterItem> {

    /**
     * 获取筛选组筛选项
     *
     * @param groupIds groupIds
     * @return Map
     */
    Map<Long, List<ApplicationFilterItem>> findItemByGroupIds(Collection<Long> groupIds);

    /**
     * 获取筛选组下所有筛选项
     *
     * @param filterGroupIds filterGroupIds
     * @return 组项map
     */
    Map<Long, Map<Long, ApplicationFilterItem>> findGroupItemMapByGroupIds(Collection<Long> filterGroupIds);

    /**
     * 保存筛选项
     *
     * @param filterGroup       filterGroup
     * @param filterGroupConfig filterGroupConfig
     */
    void saveFilterItem(ApplicationFilterGroup filterGroup, List<FilterGroupConfigDTO> filterGroupConfig);

    /**
     * 复制筛选项
     *
     * @param filterGroup  filterGroup
     * @param targetGroup  targetGroup
     * @param updateSource 是否更新源信息
     */
    void copyFilterItem(ApplicationFilterGroup filterGroup, ApplicationFilterGroup targetGroup, boolean updateSource);

    /**
     * 删除筛选项
     *
     * @param groupIds groupIds
     */
    void deleteFilterItem(Collection<Long> groupIds);
}
